<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Symfony\Component\Process\Exception\InvalidArgumentException;

abstract class Request extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }


    public function response(array $errors)
    {
        $errorCode = config(1000);
        throw new InvalidArgumentException($this->errorText . head($errors)[0], $errorCode);
    }
}
